---
layout: m1x_soap
title: Enterprise Customer Balance
---

<h1><a name="MAPI-StoreCredit-General-StoreCreditAPI"></a>Store Credit API</h1>

<p>Allows you to operate with customer virtual balance.</p>

<h3><a name="MAPI-StoreCredit-General-Module%3AEnterpriseCustomerBalance"></a>Module: Enterprise_CustomerBalance</h3>

<h4><a name="MAPI-StoreCredit-General-Resource%3Aenterprisecustomerbalance"></a>Resource: enterprise_customerbalance</h4>

<p><b>Aliases</b>: storecredit</p>

<h5><a name="MAPI-StoreCredit-General-Resource%3Aenterprisecustomerbalance-Methods"></a>Methods:</h5>

<ul>
	<li><a href="customerBalance/storecredit.balance.html" title="storecredit.balance">storecredit.balance</a> &#45; Retrieve the customer store credit balance information</li>
	<li><a href="customerBalance/storecredit.history.html" title="storecredit.history">storecredit.history</a> &#45; Retrieve the customer store credit history information</li>
</ul>


<h6><a name="MAPI-StoreCredit-General-Resource%3Aenterprisecustomerbalance-Faults"></a>Faults:</h6>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Provided data is invalid. </td>
</tr>
<tr>
<td> 101 </td>
<td> No balance found with requested parameters. </td>
</tr>
<tr>
<td> 102 </td>
<td> No history found with requested parameters. </td>
</tr>
</tbody></table>


<h4><a name="MAPI-StoreCredit-General-Resource%3Aenterprisecustomerbalancequote"></a>Resource: enterprise_customerbalance_quote</h4>

<p><b>Aliases</b>: storecredit_quote</p>

<h5><a name="MAPI-StoreCredit-General-Resource%3Aenterprisecustomerbalancequote-Methods"></a>Methods:</h5>

<ul>
	<li><a href="shoppingCartCustomerBalance/storecredit_quote.setAmount.html" title="storecredit_quote.setAmount">storecredit_quote.setAmount</a> &#45; Set amount from the customer store credit into a shopping cart (quote)</li>
	<li><a href="shoppingCartCustomerBalance/storecredit_quote.removeAmount.html" title="storecredit_quote.removeAmount">storecredit_quote.removeAmount</a> &#45; Remove amount from a shopping cart (quote) and increase the customer store credit</li>
</ul>


<h6><a name="MAPI-StoreCredit-General-Resource%3Aenterprisecustomerbalancequote-Faults"></a>Faults:</h6>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Provided data is invalid. </td>
</tr>
<tr>
<td> 103 </td>
<td> No quote found with requested id. </td>
</tr>
<tr>
<td> 104 </td>
<td> Store credit can not be used for quote created by guest. </td>
</tr>
<tr>
<td> 105 </td>
<td> No store found with requested id or code. </td>
</tr>
</tbody></table>


<h5><a name="MAPI-StoreCredit-General-Example%3A"></a>Example:</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$customerId = 10002;
$websiteId = 1;
// Get customer balance amount
$balanceAmount = $proxy-&gt;call($sessionId, 'storecredit.balance', array($customerId, $websiteId));
echo $balanceAmount . "&lt;br /&gt;";
// Get store credit history for specified customer
$balanceHistory = $proxy-&gt;call($sessionId, 'storecredit.history', array($customerId));
print_r($balanceHistory);

$quoteId = 2;
$store = 'default';
// Set customer balance use in shopping cart (quote)
$balanceAmountUsedInQuote = $proxy-&gt;call($sessionId, 'storecredit_quote.setAmount', array($quoteId, $store));
echo $balanceAmountUsedInQuote . "&lt;br /&gt;";
// Unset customer balance use in shopping cart (quote)
$balanceAmountUsedInQuote = $proxy-&gt;call($sessionId, 'storecredit_quote.removeAmount', array($quoteId));
echo $balanceAmountUsedInQuote;</pre>
		</div>
</div></div>

				    
Create the Magento file system owner                   			    
